#!/usr/bin/env python
#-*-coding:utf-8-*-

# Copyright (C) - 2011 Matías Herranz <matiasherranzgmail.com>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


#===============================================================================
# DOCS
#===============================================================================

"""Setup for NinjaIDE"""


#===============================================================================
# IMPORTS
#===============================================================================

import sys

from ez_setup import use_setuptools
use_setuptools()

from setuptools import setup

import ninja_ide


#===============================================================================
# PLATFORM SPECIFIC CODE
#===============================================================================

# we really we dont want to do any crazy things here, we simply have diff
# options per platform because we use py2app or py2exe etc...


def get_darwin_extra():
    """Return the extra setup.py config params."""
    options = {'argv_emulation': False, 'includes': ['sip', 'PyQt4._qt'],
               'iconfile': 'mac_icon.icns'}
    return dict(app=['ninja-ide.py',], options={'py2app': options},
                data_files=['--iconfile',])


#===============================================================================
# SETUP
#===============================================================================

# download_url =

# use a default empty dict
extra = dict(install_requires=["PyQt4",])

if sys.platform == 'darwin':
    # we ignore the other extras
    extra = get_darwin_extra()

setup(name=ninja_ide.__name__,
      version=ninja_ide.__version__,
      description=ninja_ide.__doc__,
      author=ninja_ide.__author__,
      author_email=ninja_ide.__mail__,
      url=ninja_ide.__url__,
      # download_url=download_url,
      license=ninja_ide.__license__,
      keywords="ninja_ide ide",
      classifiers=[
                   "Topic :: Python IDE",
                   # something like:
                   # "License :: OSI Approved :: GNU LGeneral Public License (GPL)",
                   # for the license
                   "Programming Language :: Python :: 2",
                   ],
      packages=["ninja_ide"],
      **extra
)


#===============================================================================
# MAIN
#===============================================================================

if __name__ == '__main__':
    print(__doc__)
